package day_03;

import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

/**
 * @ClassName Test06
 * @Description TODO
 * @Author hp
 * @Date 2021/6/4 15:37
 * @Version 1.0
 **/
public class Test06 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        /*int sum = 0;
        for (int i = 1; i <= 100; i++) {
            sum += i;
        }
        System.out.println(sum);*/
        /*for(int i = 1 ;i<=100;i++){
            if (i%2==0){
                System.out.print(i+" ");
            }
        }*/
        /*Scanner in = new Scanner(System.in);
        Random random = new Random();
        int rnum = random.nextInt(100);
        int sum = 0;
        for (; ; ) {
            int num = in.nextInt();
            sum++;
            if (num == rnum) {
                System.out.println(sum);
            } else if (num > rnum) {
                System.out.println("猜大了");
            } else {
                System.out.println("猜小了");
            }
        }*/
        /*for (int i = 100; i <= 999; i++) {
            int ge = i % 10;
            int shi = i / 10 % 10;
            int bai = i / 100;
            if (i == ge * ge * ge + shi * shi * shi + bai * bai * bai) {
                System.out.println(i);
            }
        }*/
        /*int a = 0;
        int b = 0;
        for (; ; ) {
            int i = in.nextInt();
            if (i == 0) {
                System.out.println("正数个数为:" + a);
                System.out.println("负数个数为:" + b);
                break;
            }
            if (i > 0) {
                a++;
            } else {
                b++;
            }
        }*/
        /*String str;
        for (int i = 1; i <= 150; i++) {
            str = "" + i;
            if (i % 3 == 0) {
                str += "\tfoo";
            }
            if (i % 5 == 0) {
                str += "\tbiz";
            }
            if (i % 7 == 0) {
                str += "\tbaz";
            }
            System.out.println(str);
        }*/
        /*int m, n;
        while (true) {
            System.out.print("请输入第一个正整数:");
            m = in.nextInt();
            if (m <= 0) {
                System.out.println("输入非法，请重新输入");
            } else {
                break;
            }
        }

        while (true) {
            System.out.print("请输入第二个正整数:");
            n = in.nextInt();
            if (n <= 0) {
                System.out.println("输入非法，请重新输入");
            } else {
                break;
            }
        }

        int max = m > n ? m : n;
        int min = m < n ? m : n;

        for (int i = min; i >= 1; i--) {
            if (m % i == 0 && n % i == 0) {
                System.out.println("最大公约数为:" + i);
                break;
            }
        }

        for (int i = max; ; i++) {
            if (i % m == 0 && i % n == 0) {
                System.out.println("最小公倍数为:" + i);
                break;
            }
        }*/
        /*for (int i = 1; i <= 100; i++) {
            int flag = 0;
            if (i % 3 == 0 || i % 5 == 0 || i % 7 == 0) {
                flag = 1;
            }
            if (flag == 0) {
                System.out.println(i);
            }
        }*/
        /*for (int i = 2; i < 1000; i++) {
            int sum = 0;
            for (int j = 1; j < i; j++) {
                if (i % j == 0) {
                    sum += j;
                }
            }
            if (sum == i) {
                System.out.println(i);
            }
        }*/
        /*for (int i = 1; i <= 9; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(j + "*" + i + "=" + j * i + "\t");
            }
            System.out.println();
        }*/
        /* int h = 1;
        for (int i = 4; i > 0; i--) {
            for (int j = 9 - h; j > 0; j--) {
                System.out.print(" ");
            }
            for (int k = h; k > 0; k--) {
                System.out.print("*");
                System.out.print(" ");
            }
            System.out.println();
            h += 2;
        }
        for (int i = 0; i < 9; i++) {
            System.out.print("*");
            System.out.print(" ");
        }
        System.out.println();
        h = 1;
        for (int i = 4; i > 0; i--) {
            for (int j = h + 1; j > 0; j--) {
                System.out.print(" ");
            }

            for (int k = 8 - h; k > 0; k--) {
                System.out.print("*");
                System.out.print(" ");
            }
            System.out.println();
            h += 2;
        }*/
        /*for (int i = 1; i <= 5; i++) {
            for (int j = 4; j >= i; j--) {
                System.out.print("  ");
            }
            for (int k = i * 2 - 1; k > 0; k--) {
                System.out.print("* ");
            }
            System.out.println();
        }
        for (int i = 1; i <= 4; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print("  ");
            }
            for (int k = 9 - i * 2; k > 0; k--) {
                System.out.print("* ");
            }
            System.out.println();
        }*/
        /*System.out.print("请输入任意数字，输入0结束:");
        int num = in.nextInt();
        int postive = 0, negetive = 0;
        while (num != 0) {
            if (num > 0) {
                postive++;
            } else {
                negetive++;
            }
            num = in.nextInt();
        }
        System.out.println("正数有:" + postive + "个");
        System.out.println("负数有:" + negetive + "个");*/
        /*System.out.println("请输入一个整数:");
        int num = in.nextInt();
        while (num != 0) {
            System.out.print(num % 10 + "\t");
            num /= 10;
        }*/

        /*System.out.println("请输入一个整数:");
        String num = in.next();
        int length = num.length();
        int i = 0;
        while (length != 0) {
            System.out.print(num.charAt(i) + "\t");
            i++;
            length--;
        }*/

        /*Random random = new Random();
        int rnum = random.nextInt(100);
        int num, count = 0;
        do {
            num = in.nextInt();
            count++;
            if (num > rnum) {
                System.out.println("猜大了");
            } else if (num < rnum) {
                System.out.println("猜小了");
            }
        } while (rnum != num);
        System.out.println("猜对了,猜了" + count + "次");*/
        for(int i=100;i>=100&&i<1000;i++){
            int ige=i%10;
            int ishi=(i/10)%10;
            int ibai=i/100;
            if(ige*ige*ige+ishi*ishi*ishi+ibai*ibai*ibai==i){
                System.out.println(i);
            }
        }
    }
}
